package com.martin.dsc.mine;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.List;

@AllArgsConstructor
@NoArgsConstructor
@Data
public class Builder extends Order {
    public static class OrderBuilder {
        private String orderId;
        private String userId;
        private List<Item> items;
        private OrderStatus status;
        private LocalDateTime createTime;

        public OrderBuilder setOrderId(String orderId) {
            this.orderId = orderId;
            return this;
        }

        public OrderBuilder setUserId(String userId) {
            this.userId = userId;
            return this;
        }

        public OrderBuilder setItems(List<Item> items) {
            this.items = items;
            return this;
        }

        public OrderBuilder setStatus(OrderStatus status) {
            this.status = status;
            return this;
        }

        public OrderBuilder setCreateTime(LocalDateTime createTime) {
            this.createTime = createTime;
            return this;
        }

        public Order build() {
            return new Order(this);
        }
    }
}
